package com.samoiloff.ui.list.smart.controller {
	import com.samoiloff.framework.controller.AbstractController;
	import com.samoiloff.ui.common.RectMc;
	import com.samoiloff.ui.list.smart.model.SmartListModel;

	import flash.events.Event;

	/**
	 * @author Samoiloff
	 */
	public class SmartListBgController extends AbstractController {
		
		private var _vModel	: SmartListModel;		
		private var _bgMc	: RectMc;		
		
		public function SmartListBgController(model: SmartListModel) {
			super(model);
			
			_vModel = model;
			
			_bgMc = _vModel.view.bgMc;
			_bgMc.alpha = 0;
			_vModel.mainMc.addChildAt(_bgMc, 0);
			
			_vModel.addEventListener(Event.RESIZE, onResize);
			onResize();
		}

		private function onResize(event: Event = null): void {
			_bgMc.draw(_vModel.width, _vModel.height);
		}
	}
}
